<template>
	<view>

	</view>
</template>

<script>
	const key = 'RAPBZ-JIWCP-HB6D4-V2RWS-LUHZE-OHF34'; //使用在腾讯位置服务申请的key  
	const referer = 'myapp'; //调用插件的app的名称  
	const location = "";
	export default {
		methods: {
			getNowAddress() {
				let _this = this;
				uni.getLocation({
					type: 'gcj02',
					success: function(res) {
						_this.location = JSON.stringify({
							latitude: res.latitude,
							longitude: res.longitude
						})
					}
				});
			},
			getMap() {
				uni.navigateTo({
					url: 'plugin://chooseLocation/index?key=' + key + '&referer=' + referer + '&location=' + location
				});
			}
		},
		created() {
			this.getNowAddress();
			this.$nextTick(() => {
				this.getMap();
			})
		}
	}
</script>

<style>
</style>
